#pragma once
#include "RBTree.h"
#include"reverse_iterator.h"

namespace zsw {
	template<class Key>
	class set
	{
		struct SETofKEY
		{
			Key operator()(const Key& k)
			{
				return k;
			}
		};
		typedef RBTree <Key, Key, SETofKEY> _set;
	public:
		typedef typename RBTree<Key, Key, SETofKEY>::const_iterator iterator;
		typedef typename RBTree<Key, Key, SETofKEY>::const_iterator const_iterator;
		typedef typename RBTree<Key, Key, SETofKEY>::reverse_iterator reverse_iterator;
		typedef typename RBTree<Key, Key, SETofKEY>::reverse_const_iterator reverse_const_iterator;
		iterator begin()
		{
			return s.begin();
		}

		iterator end()
		{
			return s.end();
		}

		const_iterator begin() const
		{
			return s.begin();
		}

		const_iterator end() const
		{
			return s.end();
		}

		reverse_iterator rbegin()
		{
			return s.rbegin();
		}

		reverse_iterator rend()
		{
			return s.rend();
		}

		reverse_const_iterator rbegin() const
		{
			return s.rbegin();
		}

		reverse_const_iterator rend() const
		{
			return s.rend();
		}


		pair<iterator, bool> insert(const Key& k)
		{
			return s.Insert(k);
		}
	private:
		_set s;
	};
}